#include "general_date_time.h"

bool operator==(const general_date &gd1, const general_date &gd2) {
  return (gd1.year == gd2.year && gd1.month == gd2.month && gd1.day == gd2.day);
} // operator==

bool operator==(const general_time &gt1, const general_time &gt2) {
  return (gt1.hour == gt2.hour && gt1.minute == gt2.minute && gt1.second == gt2.second && gt1.millisecond == gt2.millisecond);
} // operator==

bool operator>(const general_date &gd1, const general_date &gd2) {
  if (gd1.year > gd2.year) {
    return true;
  } else if (gd1.year == gd2.year) {

    if (gd1.month > gd2.month)
      return true;
    else if (gd1.month == gd2.month) {
      if (gd1.day > gd2.day)
        return true;
    } // else
  } // else

  return false;
} // operator>

bool operator<(const general_date &gd1, const general_date &gd2) {
  return !(gd1 > gd2 || gd1 == gd2);
} // operator<

bool operator>(const general_time &gt1, const general_time &gt2) {
  if (gt1.hour > gt2.hour) {
    return true;
  } else if (gt1.hour == gt2.hour) {

    if (gt1.minute > gt2.minute)
      return true;
    else if (gt1.minute == gt2.minute) {
      if (gt1.second > gt2.second)
        return true;
      else if (gt1.second == gt2.second) {
        if (gt1.millisecond > gt2.millisecond)
          return true;

      } // else
    } // else
  } // else

  return false;
} // operator>

bool operator<(const general_time &gt1, const general_time &gt2) {
  return !(gt1 > gt2 || gt1 == gt2);
} // operator<

bool operator>=(const general_date &gd1, const general_date &gd2) {
  return (gd1 > gd2 || gd1 == gd2);
} // operator>=

bool operator<=(const general_date &gd1, const general_date &gd2) {
  return (gd1 < gd2 || gd1 == gd2);
} // operator<=

bool operator>=(const general_time &gt1, const general_time &gt2) {
  return (gt1 > gt2 || gt1 == gt2);
} // operator>=

bool operator<=(const general_time &gt1, const general_time &gt2) {
  return (gt1 < gt2 || gt1 == gt2);
} // operator<=
